package homework.api.day02._cp;

public class IntegerDemo {
    public static void main(String[] args) {
        Integer i1 = new Integer(5);
        Integer i2 = new Integer(5);
        System.out.println(i1==i2);
        System.out.println(i1.equals(i2));

        Integer i3 = Integer.valueOf(5);
        Integer i4 = Integer.valueOf(5);
        System.out.println(i3==i4);
        System.out.println(i3.equals(i4));

        Integer i5 = 128;
        Integer i50 = Integer.valueOf(128);

        int i6 = i5;
        int i60 = i5.intValue();

        long max = Long.MAX_VALUE;
        long min = Long.MIN_VALUE;
        System.out.println(max+",  "+min);


        String num1 = "-852";
        if(num1.matches("-?\\d+")){
            int n1 = Integer.parseInt(num1);
            System.out.println(n1);
        }

        String num2 = "-.789";
        if(num2.matches("-?\\d*\\.?\\d*")){
            double n2 = Double.parseDouble(num2);
            System.out.println(n2);
        }



    }
}
